﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;
using BLL = MS.InformationManagement.BLL;

namespace MS.InformationManagement.Presenter.DocumentsTemplate
{
    public class DocumentsTemplatePresenter : BasePresenter<IDocumentsTemplateView>
    {
        #region Constructors

        public DocumentsTemplatePresenter(IDocumentsTemplateView view) : base(view){}

        #endregion

        #region Public Methods

        public void HandleLoad()
        {
            View.Templates = BLL.DocumentsTemplates.DocumentsTemplates.GetAllTemplates();
            View.Show();
        }

        public void HandleCreateNewDocument()
        {
            View.NewDocument = BLL.DocumentsTemplates.DocumentsTemplates.CreateNewDocument(View.NewDocumentName, View.TemplateId);
            View.ShowCreatedFile();
        }

        #endregion

    }
}
